package com.yinkgh.mybatis.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yinkgh.datasource.DataSource;
import com.yinkgh.datasource.DataSourceType;
import com.yinkgh.mybatis.common.service.impl.BaseServiceImpl;
import com.yinkgh.mybatis.dao.EmployeeMapper;
import com.yinkgh.mybatis.model.Employee;

@Service
public class EmployeeService  extends BaseServiceImpl<Employee> implements EmployeeMapper {
	
	@Autowired
	EmployeeMapper employeeMapper;
	
	public EmployeeMapper getDao() {
		return employeeMapper;
	}
	
	@DataSource(DataSourceType.DATASOURCEA)
	@Transactional(readOnly=false)
	public int addEmployee(Employee employee) {
		int a = 1 / 0;
		return insert(employee);
	}
	
}
